package com.haibo.test.constant;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;

import java.util.concurrent.Executors;

/**
 * @Classname SchedulingConfiguration <br>
 * @Description TODO  <br>
 * @Date 2020-5-7 9:15 <br>
 * @Created by mxw74 <br>
 */
@Configuration
public class SchedulingConfiguration implements SchedulingConfigurer {
    @Override
    public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {

//参数传入一个size为10的线程池
        scheduledTaskRegistrar.setScheduler(Executors.newScheduledThreadPool(500));
    }


}
